<%@ Page Title="" Language="C#" MasterPageFile="~/Employee.master" AutoEventWireup="true" CodeFile="AddStock.aspx.cs" Inherits="Pages_Employee_Manage_Stocks_AddStock" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />

<script type="text/javascript" language="javascript">
    function onlyNumbers(evt) {
        var e = event || evt; // for trans-browser compatibility
        var charCode = e.which || e.keyCode;

        if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

        return true;

    }
</script>

<span class="header">Add Stock</span>
<br />
<br />
<div>
     <%--   <asp:UpdatePanel ID="udpAddStock" runat="server">
            <ContentTemplate>--%>
            
    <table class="table01">
        <tr>
            <td width="20%">
                &nbsp;</td>
            <td width="40%">
                &nbsp;</td>
        </tr>
        <tr>
            <td width="20%">
                <b>
                    <asp:Label ID="lblDeliveryNumber" runat="server" Text="Deliverable ID"></asp:Label></b>
            </td>
            <td width="40%">
                <asp:TextBox ID="txtDeliveryNumber" runat="server" onkeypress="return onlyNumbers();" 
                    Width="128px" onkeyup="idChecker(this.value);"></asp:TextBox>
               
                <asp:RequiredFieldValidator ID="valDeliveryNumber" runat="server" ControlToValidate="txtDeliveryNumber"
                    ValidationGroup="AddStock" ErrorMessage="Delivery number cannot be blank"
                    Text="*"></asp:RequiredFieldValidator>
               <span id="spanAlert"></span>
                <asp:RegularExpressionValidator ID="valDeliverableID" runat="server" 
                    ControlToValidate="txtDeliveryNumber" ValidationGroup="AddStock"
                    ErrorMessage="Deliverable ID is not valid" ValidationExpression="^[1-9][0-9]*$">*</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td width="20%">
                <b>
                    <asp:Label ID="lblFromStock" runat="server" Text="From Stock"></asp:Label></b>
            </td>
            <td width="40%">
                <asp:DropDownList ID="ddlFromStock" runat="server" DataSourceID="ObjectDataSourceFromStock"
                    DataTextField="BranchName" DataValueField="PinCode" 
                    ValidationGroup="AddStock">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSourceFromStock" runat="server" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="ListStock" 
                    TypeName="DALStock">
                </asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td width="20%">
                <b>
                    <asp:Label ID="lblToStock" runat="server" Text="To Stock"></asp:Label></b>
            </td>
            <td width="40%">
                <asp:DropDownList ID="ddlToStock" runat="server" DataSourceID="ObjectDataSourceToStock"
                    DataTextField="BranchName" DataValueField="PinCode" 
                    ValidationGroup="AddStock">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="ObjectDataSourceToStock" runat="server" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="ListStock" 
                    TypeName="DALStock">
                </asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td width="20%">
                <b>
                    <asp:Label ID="lblReceivedDate" runat="server" Text="Received Date"></asp:Label></b>
            </td>
           <td width="40%">
                <asp:TextBox runat="server" ID="txtReceivedDate" autocomplete="off" ValidationGroup="AddStock" />
              <%--  <ajaxToolkit:CalendarExtender ID="CalendarExtenderReceived" runat="server" TargetControlID="txtReceivedDate"
                    CssClass="MyCalendar" Format="yyyy-MM-dd" PopupPosition="BottomRight" />--%>
                <asp:RequiredFieldValidator ID="valBirthDate" runat="server" ControlToValidate="txtReceivedDate"
                    ValidationGroup="AddStock" ErrorMessage="Received date cannot be blank"
                    Text="*"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionReceivedDate" runat="server"
                    ErrorMessage="Received Date is not valid" ControlToValidate="txtReceivedDate"
                    ValidationGroup="AddStock" 
                    ValidationExpression="(?n:^(?=\d)((?<day>31(?!(.0?[2469]|11))|30(?!.0?2)|29(?(.0?2)(?=.{3,4}(1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00))|0?[1-9]|1\d|2[0-8])(?<sep>[/.-])(?<month>0?[1-9]|1[012])\2(?<year>(1[6-9]|[2-9]\d)\d{2})(?:(?=\x20\d)\x20|$))?(?<time>((0?[1-9]|1[012])(:[0-5]\d){0,2}(?i:\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$)">*</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td width="20%">
                <b>
                    <asp:Label ID="lblSentDate" runat="server" Text="Send Date"></asp:Label></b>
            </td>
         <td width="40%">
                <asp:TextBox runat="server" ID="txtSentDate" autocomplete="off" ValidationGroup="AddStock" />
               <%-- <ajaxToolkit:CalendarExtender ID="CalendarExtenderSend" runat="server" TargetControlID="txtSentDate"
                    CssClass="MyCalendar" Format="yyyy-MM-dd" PopupPosition="BottomRight" />--%>
                <asp:RegularExpressionValidator ID="RegularExpressionSentDate" runat="server" ErrorMessage="SentDate is not valid"
                    ControlToValidate="txtSentDate" ValidationGroup="AddStock" 
                    ValidationExpression="(?n:^(?=\d)((?<day>31(?!(.0?[2469]|11))|30(?!.0?2)|29(?(.0?2)(?=.{3,4}(1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|(16|[2468][048]|[3579][26])00))|0?[1-9]|1\d|2[0-8])(?<sep>[/.-])(?<month>0?[1-9]|1[012])\2(?<year>(1[6-9]|[2-9]\d)\d{2})(?:(?=\x20\d)\x20|$))?(?<time>((0?[1-9]|1[012])(:[0-5]\d){0,2}(?i:\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$)">*</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td width="20%">
                <b>
                    <asp:Label ID="lblDelivery" runat="server" Text="Delivery To Customer"></asp:Label></b>
            </td>
            <td width="40%">
                <asp:CheckBox ID="ckbStatus" runat="server" ValidationGroup="AddStock" />
              <%--  <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                    <ProgressTemplate>
                        <img alt="" src="../../Images/indicator.gif" style="width: 16px; height: 16px" />loadding
                    </ProgressTemplate>
                </asp:UpdateProgress>--%>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
                    ValidationGroup="AddStock" onclick="btnSubmit_Click" />
                <asp:Button ID="btnReset" runat="server" Text="Reset" CausesValidation="false" 
                    ValidationGroup="AddStock" onclick="btnReset_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="AddStock" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;</td>
        </tr>
         <tr>
            <td colspan="2">
                <asp:Label ID="lblMessage" runat="server" Font-Italic="True" Font-Bold="True" 
                    ForeColor="Red"></asp:Label>
               </td>
        </tr>
    </table>
        <%--    </ContentTemplate>
        </asp:UpdatePanel>--%>
    </div>
    
    <script type="text/javascript" src="../../Scripts/checkid.js"></script>
</asp:Content>

<%--  
    <td width="40%">
        <asp:TextBox runat="server" ID="txtReceivedDate" autocomplete="off" ValidationGroup="AddStock" />
        <ajaxToolkit:CalendarExtender ID="CalendarExtenderReceived" runat="server" TargetControlID="txtReceivedDate"
            CssClass="MyCalendar" Format="yyyy-MM-dd" PopupPosition="BottomRight" />
        <asp:RequiredFieldValidator ID="valBirthDate" runat="server" ControlToValidate="txtReceivedDate"
            ValidationGroup="AddStock" ErrorMessage="Please set forcus to choose The day to received deliverable"
            Text="*"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionReceivedDate" runat="server"
            ErrorMessage="Received Date is not valid" ControlToValidate="txtReceivedDate"
            ValidationGroup="AddStock" ValidationExpression="(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])">*</asp:RegularExpressionValidator>
    </td>
    <td width="40%">
        <asp:TextBox runat="server" ID="txtSentDate" autocomplete="off" ValidationGroup="AddStock" />
        <ajaxToolkit:CalendarExtender ID="CalendarExtenderSend" runat="server" TargetControlID="txtSentDate"
            CssClass="MyCalendar" Format="yyyy-MM-dd" PopupPosition="BottomRight" />
        <asp:RequiredFieldValidator ID="valSentDate" runat="server" ControlToValidate="txtSentDate"
            ValidationGroup="AddStock" ErrorMessage="Please set forcus to choose The day to send deliverable"
            Text="*"></asp:RequiredFieldValidator>
        <asp:RegularExpressionValidator ID="RegularExpressionSentDate" runat="server" ErrorMessage="SentDate is not valid"
            ControlToValidate="txtSentDate" ValidationGroup="AddStock" ValidationExpression="(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])">*</asp:RegularExpressionValidator>
    </td>
--%>